home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / imagine / extras / tools / isl3_0b6 / samples / frames.c < prev    next >
C/C++ Source or Header  |  1994-11-01  |  3KB  |  82 lines

  1. /*
  2.    frames.c - Copyright but freely distributable as part of the ISL package
  3.    (c) 1994 by Grizzly Bear Labs.  This is a small example of how to generate
  4.    an ISL stage using a c program - look at it and learn, but don't bother
  5.    generating the frames because they are boring!  :-)
  6. */
  7.  
  8. #include <stdio.h>
  9.  
  10. #define INC 16
  11. #define MAX ((INC*INC*2)-1)
  12. #define RATIO (169.0 / (MAX * MAX))
  13.  
  14. main()
  15. {
  16.     int frames = 1, t, cnt = -1, toggle = 0;
  17.     float pos;
  18.  
  19.     printf("STAGE\nMAXFRAMES %d LOOP 0\n\n", MAX + 1);
  20.  
  21.     printf("CAMERA \"CAMERA\" LAYER 0\n");
  22.     printf("POSITION FRAMES 1 1 XYZ 0. -600. -100. VELOCITY 1. 1. SPLINE\n");
  23.     printf("ALIGN FRAMES 1 1 XYZ 0. 0. 0. VELOCITY 1. 1.\n");
  24.     printf("SIZE FRAMES 1 1 XYZ 320. 640. 233.333333 VELOCITY 1. 1.\n\n");
  25.  
  26.     printf("GLOBALS \"GLOBALS\" LAYER 0\n");
  27.     printf("ACTOR FRAMES 1 1 BRUSH \"\" 0 BACKDROP \"\" 0 ");
  28.     printf("AMBIENT RGB 0. 0. 0. HORIZON RGB 0. 255. 255. ");
  29.     printf("+ZENITH RGB 255. 0. 255. -ZENITH RGB 255. 0. 255. ");
  30.     printf("FOG BTL 0. 0. 0. FOG RGB 0. 0. 0. ");
  31.     printf("STARFIELD 0. TRANSITION 0\n\n");
  32.  
  33.     printf("LIGHT \"LIGHTSOURCE\" LAYER 0\n");
  34.     printf("ACTOR FRAMES 1 %d POINT SHADOW ", MAX + 1);
  35.     printf("RGB 512. 512. 512. TRANSITION 0\n");
  36.     printf("POSITION FRAMES 1 1 XYZ 102. -158.000473 102.666656 VELOCITY 1. 1. SPLINE\n");
  37.     printf("ALIGN FRAMES 1 1 XYZ 0. 0. 0. VELOCITY 1. 1.\n");
  38.     printf("SIZE FRAMES 1 1 XYZ 32. 32. 32. VELOCITY 1. 1.\n\n");
  39.  
  40.     printf("OBJECT \"GROUND\" LAYER 0\n");
  41.     printf("ACTOR FRAMES 1 %d NAME \"Bounce.imp/objects/ground\" ", MAX + 1);
  42.     printf("STATE \"\" CYCLE 0. 0. VELOCITY 1. 0.\n");
  43.     printf("POSITION FRAMES 1 1 XYZ 0. 0. -201.000320 VELOCITY 1. 1. SPLINE\n");
  44.     printf("ALIGN FRAMES 1 1 XYZ 0. 0. 0. VELOCITY 1. 1.\n");
  45.     printf("SIZE FRAMES 1 1 XYZ 320. 200. 1. VELOCITY 1. 1.\n\n");
  46.  
  47.     printf("OBJECT \"BALL\" LAYER 0\n");
  48.     printf("ACTOR FRAMES 1 %d NAME \"Bounce.imp/objects/ball\" ", MAX + 1);
  49.     printf("STATE \"\" CYCLE 0. 0. VELOCITY 1. 0.\n");
  50.     for (t = 1; t < MAX; t++) {
  51.         cnt++;
  52.         if (cnt == INC) {
  53.             toggle = toggle ? 0 : 1;
  54.             cnt = 0;
  55.         }
  56.         if (toggle)
  57.             continue;
  58.         pos = ((float) (t * t)) * RATIO;
  59.         printf("POSITION FRAMES %d %d XYZ 0. 0. -%.6f VELOCITY 1. 1. SPLINE\n",
  60.             frames, frames, pos);
  61.         frames++;
  62.     }
  63.  
  64.     for (t = MAX; t > 0; t--) {
  65.         cnt++;
  66.         if (cnt == INC) {
  67.             toggle = toggle ? 0 : 1;
  68.             cnt = 0;
  69.         }
  70.         if (toggle)
  71.             continue;
  72.         pos = ((float) (t * t)) * RATIO;
  73.         printf("POSITION FRAMES %d %d XYZ 0. 0. -%.6f VELOCITY 1. 1. SPLINE\n",
  74.             frames, frames, pos);
  75.         frames++;
  76.     }
  77.     printf("ALIGN FRAMES 1 1 XYZ 0. 0. 0. VELOCITY 1. 1.\n");
  78.     printf("SIZE FRAMES 1 1 XYZ 32. 32. 32. VELOCITY 1. 1.\n\n");
  79.  
  80. }
  81.  
  82.